package com.suray.rgv.son.task;

import com.suray.basic.wcs.path.core.Node;
import com.suray.basic.wcs.utils.WcsFuncUtil;
import com.suray.rgv.son.data.RgvSonControlBean;
import com.suray.rgv.son.util.RgvSonActionResult;

import java.util.List;

/**
 * 子车任务
 */
public class RgvSonTask {
    /**
     * 母车的任务id
     */
    private Object taskId;

    /**
     * 任务路径
     */
    private List<Node> nodes;

    /**
     * 指令编号
     * 判断任务是否完成
     */
    private int actionNo;

    private RgvSonActionResult actionResult;

    public RgvSonTask(Object taskId, int actionNo, List<Node> nodes) {
        this.taskId = taskId;
        this.actionNo = actionNo;
        this.nodes = nodes;
        this.actionResult = RgvSonActionResult.INVALID;
    }

    public RgvSonTask(Object taskId, List<Node> nodes) {
        this.taskId = taskId;
        this.nodes = nodes;
        this.actionResult = RgvSonActionResult.INVALID;
    }

    public RgvSonActionResult getActionResult() {
        return actionResult;
    }

    public void setActionResult(RgvSonActionResult actionResult) {
        this.actionResult = actionResult;
    }

    public Object getTaskId() {
        return taskId;
    }

    public int getActionNo() {
        return actionNo;
    }

    public List<Node> getNodes() {
        return nodes;
    }

    @Override
    public String toString() {
        return "RgvSonTask{" +
                "taskId=" + taskId +
                ", nodes=" + WcsFuncUtil.listToString(nodes) +
                ", actionNo=" + actionNo +
                ", actionResult=" + actionResult +
                '}';
    }
}
